#!/bin/bash
############################################ 
parasnum=3
# function
help_msg()
{
cat << help
+----------------------------------------------------+
+ Error Cause:
+ you enter $# parameters
+ the total paramenter number must be $parasnum
+ 1st :groupId
+ 2nd :artifactId
+ 3rd :version
+----------------------------------------------------+
help
} 
# ----------------------------------------------------
# Check parameter number
# ----------------------------------------------------
if [ $# -ne ${parasnum} ]
then
        help_msg
        exit
fi 
groupId=$1
artifactId=$2
version=$3
mvn archetype:generate \
-DarchetypeCatelog=http://maven.junxinweike.cn/nexus/content/groups/public/archetype-catalog.xml \
-DgroupId=${groupId}  \
-DartifactId=${artifactId} \
-Dversion=${version} \
-DarchetypeGroupId=com.ailikes  \
-DarchetypeArtifactId=lotus-model-archetype \
-DarchetypeVersion=1.0.1-SNAPSHOT \
-DinteractiveMode=false 

